package com.javaweb.admin.controller;

import com.javaweb.admin.query.KdlPurchaseinQuery;
import com.javaweb.admin.query.KdlPurchaseweQuery;
import com.javaweb.admin.service.IKdlPurchaseweService;
import com.javaweb.common.common.BaseController;
import com.javaweb.common.utils.JsonResult;
import com.javaweb.system.utils.ShiroUtils;
import com.seegw.shaphar.IKDLService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/kdlpurchasewe")
public class KdlPurchaseweController extends BaseController {
    @Autowired
    private IKdlPurchaseweService kdlPurchaseweService;


    @GetMapping("/index")
    public JsonResult index(KdlPurchaseweQuery query) {
        return kdlPurchaseweService.getPurchaseweList(query);
    }

    @GetMapping("/detail")
    public JsonResult detail(KdlPurchaseweQuery query) {
        return kdlPurchaseweService.getPruchaseweDetail(query.getPid());
    }

    @PostMapping("/syncpurchase")
    public JsonResult syncpurchase(KdlPurchaseweQuery query){
        return kdlPurchaseweService.syncPurchase(query);
    }
}
